package com.example.universitylibraryback.pipeline;

import java.util.Date;

/**
 * 借阅请求上下文，用于过滤器间数据传递
 */
public class BorrowContext {
    private String rawInput;       //原始输入
    private String readerId;       //读者证号
    private String bookId;         //图书ID
    private boolean isValid = true; //数据有效性标识
    private String errorMsg = "";  //错误信息
    private String borrowRecordId; //借阅记录ID
    private Date borrowDate;       //借阅日期
    private Date dueDate;          //到期日期

    //构造函数
    public BorrowContext(String rawInput) {
        this.rawInput = rawInput;
    }

    // getter与setter方法
    public String getRawInput() { return rawInput; }
    public void setRawInput(String rawInput) { this.rawInput = rawInput; }
    public String getReaderId() { return readerId; }
    public void setReaderId(String readerId) { this.readerId = readerId; }
    public String getBookId() { return bookId; }
    public void setBookId(String bookId) { this.bookId = bookId; }
    public boolean isValid() { return isValid; }
    public void setValid(boolean valid) { isValid = valid; }
    public String getErrorMsg() { return errorMsg; }
    public void setErrorMsg(String errorMsg) { this.errorMsg = errorMsg; }
    public String getBorrowRecordId() { return borrowRecordId; }
    public void setBorrowRecordId(String borrowRecordId) { this.borrowRecordId = borrowRecordId; }
    public Date getBorrowDate() { return borrowDate; }
    public void setBorrowDate(Date borrowDate) { this.borrowDate = borrowDate; }
    public Date getDueDate() { return dueDate; }
    public void setDueDate(Date dueDate) { this.dueDate = dueDate; }
}